<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="待处置" name="unDispose">
        <un-dispose ref="unDispose"/>
      </el-tab-pane>
      <el-tab-pane label="已处置" name="disposed">
        <disposed ref="disposed"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import disposed from "@/views/check/dispose/disposed";
import unDispose from "@/views/check/dispose/undispose";
export default {
  name: "dealIndex",
  components: {unDispose, disposed},
  data() {
    return {
      activeName: 'unDispose'
    };
  },
  mounted() {
    // 确保子组件渲染完成
    this.$nextTick(() => {
      this.$refs.unDispose.getList();
    });
  },
  methods: {
    handleClick(tab, event) {
      // tab.name 就是 el-tab-pane 的 name
      if (tab.name === 'disposed') {
        this.$refs.disposed.getList()
      }
      if (tab.name === 'unDispose') {
        this.$refs.unDispose.getList()
      }
    }
  }
}
</script>

<style scoped>

</style>
